package com.cskaoyan.dbutils;

import com.cskaoyan.connectionpool.dbcp.DruidUtils;
import org.apache.commons.dbutils.QueryRunner;

import java.sql.Connection;
import java.sql.SQLException;

/**
 * 创建日期: 2022/07/28 16:14
 *
 * @author ciggar
 */
public class DButilsDemo1 {


    public static void main(String[] args) throws SQLException {

        // 获取连接
        Connection connection = DruidUtils.getConnection();


        // 创建一个QueryRunner
        QueryRunner queryRunner = new QueryRunner();


        // 执行SQL语句
        int affectedRows = queryRunner.update(connection, "delete from account where id = 1005");

        System.out.println(affectedRows);

        // 回收连接
        connection.close();


    }




}
